﻿@model GPS.ENTITYS.CrudModelCOSODT

@{
    ViewBag.Title = "Chỉnh Sửa Cơ Sở Đào Tạo";
}

<style type="text/css">
    .btn-file {
        position: relative;
        overflow: hidden;
    }

        .btn-file input[type=file] {
            position: absolute;
            top: 0;
            right: 0;
            min-width: 100%;
            min-height: 100%;
            font-size: 100px;
            text-align: right;
            filter: alpha(opacity=0);
            opacity: 0;
            background: red;
            cursor: inherit;
            display: block;
        }

    input[readonly] {
        background-color: white !important;
        cursor: text !important;
    }
</style>

@using (Html.BeginForm("Edit", "GPS_CoSoDaoTao", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)
    @*<div id="tabs">*@
    @*<ul>
            <li><a href="#tabs-1">Hồ sơ phương tiện</a></li>
        </ul>*@
    <h3 class="text-center fdb-title-search-form">Chỉnh Sửa Cơ Sở Đào Tạo</h3>
    <div id="tabs-1">
        @Html.Hidden("IsEdit", 0)
        <fieldset class="fs_body">
            <legend class="head_title">Thông tin Cơ Sở Đào Tạo</legend>

            <div class="row margin-top-05">
                <div class="col-md-2 control-label">
                    Mã Loại Hồ Sơ<span style="color:red;">(*)</span>
                </div>
                <div class="col-md-4 control-txt">
                    @Html.TextBoxFor(model => model.DVGTVT_MA, new { @class = "form-control", @id = "DVGTVT_MA", @readonly = "readonly" })
                    @Html.ValidationMessageFor(model => model.DVGTVT_MA)
                </div>
            </div>

            <div class="row margin-top-05">
                <div class="col-md-2 control-label">
                    Tên Đơn Vị GTVT<span style="color:red;">(*)</span>
                </div>
                <div class="col-md-4 control-txt">
                    @Html.TextBoxFor(model => model.DVGTVT_TEN, new { @class = "form-control" })
                    @Html.ValidationMessageFor(model => model.DVGTVT_TEN)
                </div>
            </div>

            <div class="row margin-top-05">
                <div class="col-md-2 control-label">
                    Tên Đơn Vị GTVT Quản Lý<span style="color:red;">(*)</span>
                </div>
                <div class="col-md-4 control-txt">
                    @Html.DropDownListFor(model => model.DVGTVT_MAQL, (SelectList)ViewBag.lstDVGTVT, "--Lựa Chọn--", new { @class = "form-control", @id = "DVGTVT_MAQL", @readonly = "readonly" })
                </div>
            </div>

            <div class="row margin-top-05">
                <div class="col-md-2 control-label">
                    Loại Cơ Quan Sát Hạch<span style="color:red;">(*)</span>
                </div>
                <div class="col-md-4 control-txt">
                    @Html.TextBoxFor(model => model.DVGTVT_LOAICQSH, new { @class = "form-control" })
                </div>
            </div>

            <div class="row margin-top-05">
                <div class="col-md-2 control-label">
                    Hạng Giấp Phép Lái Xe<span style="color:red;">(*)</span>
                </div>
                <div class="col-md-4 control-txt">
                    @Html.TextBoxFor(model => model.DVGTVT_HANGGPLX, new { @class = "form-control" })
                </div>
            </div>

            <div class="row margin-top-05">
                <div class="col-md-2 control-label">
                    Điện Thoại
                </div>
                <div class="col-md-4 control-txt">
                    @Html.TextBoxFor(model => model.DVGTVT_TEL, new { @class = "form-control" })
                </div>
            </div>

            <div class="row margin-top-05">
                <div class="col-md-2 control-label">
                    FAX
                </div>
                <div class="col-md-4 control-txt">
                    @Html.TextBoxFor(model => model.DVGTVT_FAX, new { @class = "form-control" })
                </div>
            </div>

            <div class="row margin-top-05">
                <div class="col-md-2 control-label">
                    Địa Chỉ:
                </div>
                <div class="col-md-4 control-txt">
                    @Html.TextBoxFor(model => model.DVGTVT_ADD, new { @class = "form-control" })
                </div>
            </div>

            <div class="row margin-top-05">
                <div class="col-md-2 control-label">
                    Lãnh Đạo
                </div>
                <div class="col-md-4 control-txt">
                    @Html.TextBoxFor(model => model.DVGTVT_LANHDAO, new { @class = "form-control" })
                </div>
            </div>

            <div class="row margin-top-05">
                <div class="col-md-2 control-label">
                    Website
                </div>
                <div class="col-md-4 control-txt">
                    @Html.TextBoxFor(model => model.DVGTVT_WEBSITE, new { @class = "form-control" })
                </div>
            </div>

            <div class="row margin-top-05">
                <div class="col-md-2 control-label">
                    Diện Tích
                </div>
                <div class="col-md-4">
                    @Html.TextBoxFor(model => model.DVGTVT_DIENTICH, new { @class = "form-control" })
                </div>
            </div>

            <div class="row margin-top-05">
                <div class="col-md-2 control-label">
                    Tổng Lưu Lượng Đào Tạo:
                </div>
                <div class="col-md-4 control-txt">
                    @Html.TextBoxFor(model => model.DVGTVT_LLDT, new { @class = "form-control" })
                </div>
            </div>

            <div class="row margin-top-05">
                <div class="col-md-2 control-label">
                    Số Giấy Phép
                </div>
                <div class="col-md-4">
                    @Html.TextBoxFor(model => model.DVGTVT_SOGP, new { @class = "form-control" })
                </div>
            </div>

            <div class="row margin-top-05">
                <div class="col-md-2 control-label">
                    Ngày Cấp Giấy Phép:
                </div>
                <div class="col-md-4 control-txt">
                    @Html.TextBoxFor(model => model.DVGTVT_NGAYGP, "{0:dd/MM/yyyy}", new { @class = "form-control" })
                </div>
            </div>


            <div class="row margin-top-05">
                <div class="col-md-2 control-label">
                    Ngày Hết Hạn Giấy Phép:
                </div>
                <div class="col-md-4">
                    @Html.TextBoxFor(model => model.DVGTVT_NGAYHHGP, "{0:dd/MM/yyyy}", new { @class = "form-control"})
                </div>
            </div>


            <div class="row margin-top-05">
                <div class="col-md-2 control-label">
                    Địa Điểm:
                </div>
                <div class="col-md-4 control-txt">
                    @Html.TextBoxFor(model => model.DVGTVT_DIADIEM, new { @class = "form-control" })
                </div>
            </div>

            <div class="row margin-top-05">
                <div class="col-md-2 control-label">
                    Mô Tả:
                </div>
                <div class="col-md-4 control-txt">
                    @Html.TextAreaFor(model => model.DVGTVT_MOTA, new { @class = "form-control", @rows = 5 })
                </div>
            </div>

            <div class="row margin-top-05">
                <div class="col-md-2 control-label">
                    Trạng Thái:<span style="color:red;">(*)</span>
                </div>
                <div class="col-md-4">
                    @Html.DropDownListFor(model => model.DVGTVT_ACTIVE, new List<SelectListItem>
                                {
                                    new SelectListItem() {Text = "--Lựa Chọn--", Value=""},
                                    new SelectListItem() {Text = "Không Hiệu Lực", Value="0"},
                                    new SelectListItem() {Text = "Hiệu Lực", Value="1"}

                                }, new { @class = "form-control"})
                </div>
            </div>
        </fieldset>
    </div>
    @*</div>*@
    <br />
    <div class="row">
        <div class="col-md-12">
            @*<input type="submit" value="Cập nhật" class="btn btn-info btn-sm" />*@
            <button type="submit" class="btn btn-danger btn-sm">
                <span class="glyphicon glyphicon-floppy-disk"></span> Cập nhật
            </button>
            &nbsp;&nbsp;
            @Html.ActionLink("Quay lại", "Index", null, new { @class = "btn btn-primary btn-sm" })
        </div>

    </div>
}

<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>

<script src="~/Scripts/datepicker.js"></script>
<script src="~/Scripts/jquery-ui-1.11.4.js"></script>
<script src="~/Scripts/jquery.maskedinput.js"></script>
<script src="~/Scripts/jquery.maskMoney.js"></script>
<script src="~/Scripts/jquery.number.js"></script>
<script src="~/Scripts/jquery.masknumber.js"></script>
<script src="~/Scripts/moment.js"></script>

<script type="text/javascript">

    // Voi jQuery 1.9 > thi chi validate gia tri trong active tab
    // Muon validate nhung gia tri trong cac tab khac nua thi dung jquery.validate 1.8.1 or 1.7


    // mask edit cho truong ngay thang (su dung jquery.maskedinput)


    function ToJavaScriptDate(value) {
        if (value != null) {
            var pattern = /Date\(([^)]+)\)/;
            var results = pattern.exec(value);
            var dt = new Date(parseFloat(results[1]));
            return dt.getDate() + "/" + (dt.getMonth() + 1) + "/" + dt.getFullYear();
        }
        return null;
    }
</script>

<script type='text/javascript'>
    $(document).on('change', '.btn-file :file', function () {
        var input = $(this),
            numFiles = input.get(0).files ? input.get(0).files.length : 1,
            label = input.val().replace(/\\/g, '/').replace(/.*\//, '');
        input.trigger('fileselect', [numFiles, label]);
    });

    function preview_image(event) {
        var reader = new FileReader();
        reader.onload = function () {
            var output = document.getElementById('output_image');
            output.src = reader.result;
        }
        reader.readAsDataURL(event.target.files[0]);
    }
</script>

<script type="text/javascript">
    $("#DVGTVT_NGAYGP").datepicker({
        changeMonth: true,
        changeYear: true,
        dateFormat: 'dd/mm/yy'
    });

    $("#DVGTVT_NGAYHHGP").datepicker({
        changeMonth: true,
        changeYear: true,

        dateFormat: 'dd/mm/yy'
    });


    $("#DVGTVT_NGAYGP").mask("99/99/9999", { placeholder: "dd/mm/yyyy" });
    $("#DVGTVT_NGAYHHGP").mask("99/99/9999", { placeholder: "dd/mm/yyyy" });
    // cho phep nhap so thap phan (su dung jquery.number)
    //$("#GV_THAMNIENLX").number(true, 2, '.', '');

</script>

@Styles.Render("~/Content/themes/base/css")


